import 'package:flutter/material.dart';
import 'package:flutter_eve_plugin/constants/font_family.dart';
import 'package:flutter_eve_plugin/constants/font_weight.dart';
import 'package:flutter_eve_plugin/model/ye_xiu/checkpoint/stageinfo.dart';
import 'package:flutter_eve_plugin/utils/screen_util.dart';

class ChechpointDialogListWidget extends StatelessWidget {
  final CheckpointStageInfo info;
  const ChechpointDialogListWidget({Key key, this.info}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.only(
          left: setRatio(28), right: setRatio(28), top: setRatio(20)),
      child: Container(
        width: setRatio(291),
        height: setRatio(80),
        child: GridView.builder(
          scrollDirection: Axis.horizontal,
          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
              mainAxisSpacing: setRatio(10),
              crossAxisCount: 1,
              childAspectRatio: 80 / 50),
          itemCount: info?.awardList?.length ?? 0,
          itemBuilder: (context, index) {
            var awardInfo = info?.awardList[index];
            return Container(
              width: setRatio(50),
              height: setRatio(80),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.start,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: <Widget>[
                  Stack(
                    children: <Widget>[
                      Image.network(
                        awardInfo?.pic ?? '',
                        width: setRatio(50),
                        height: setRatio(50),
                        fit: BoxFit.fill,
                      ),
                      // Positioned(
                      //   right: 0,
                      //   bottom: 0,
                      //   child: Container(
                      //     width: setRatio(17),
                      //     height: setRatio(17),
                      //     decoration: BoxDecoration(
                      //         color: Color(0xbF000000),
                      //         borderRadius: BorderRadius.only(
                      //             topLeft: Radius.circular(setRatio(2)),
                      //             bottomRight: Radius.circular(setRatio(2)))),
                      //     child: Center(
                      //       child: Text(
                      //         '${awardInfo?.count ?? 0}',
                      //         style: TextStyle(
                      //             decoration: TextDecoration.none,
                      //             color: Color(0xFFFFFFFF),
                      //             fontFamily: FontFamily.PINGFANG,
                      //             fontWeight: FontWeightCustom.PF_Medium,
                      //             fontSize: setTextSp(10)),
                      //       ),
                      //     ),
                      //   ),
                      // )
                    ],
                  ),
                  SizedBox(
                    height: setRatio(2),
                  ),
                  SizedBox(
                    width: setRatio(50),
                    child: Text(
                      awardInfo?.itemName ?? '',
                      maxLines: 2,
                      overflow: TextOverflow.ellipsis,
                      style: TextStyle(
                          decoration: TextDecoration.none,
                          fontFamily: FontFamily.PINGFANG,
                          fontWeight: FontWeightCustom.PF_Medium,
                          fontSize: setTextSp(10),
                          color: Color(0xFFEFF0F8)),
                    ),
                  )
                ],
              ),
            );
          },
        ),
      ),
    );
  }
}
